<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>浏览器提示问题</title>
</head>

<body>
  <script>
    // do {
    //   var result = prompt('你爱不爱我？')
    // }
    // while (result != '爱' && result != 'yes')
    // alert('我也爱你')

    while (result != '爱' && result != 'yes') {
      var result = prompt('你爱不爱我？')
    }
    alert('我也爱你')
  </script>
</body>

</html>